home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 3 / The Pier Shareware Number 3 (The Pier Exchange) (1993).iso / 024 / gpal101g.exe / GPAL.DOC < prev    next >
Text File  |  1993-08-11  |  7KB  |  242 lines

  1.  
  2.                 GPAL v1.01  (C) Copyright 1993 Peak Computing
  3.                 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4.                      Designed & Written by Brian Manning
  5.  
  6.  
  7. * What is GPAL?
  8.  
  9.   GPAL is a collection of graphic palette fading routines for VGA display
  10.   adapters.  These routines work in all graphic video modes (1,2,7,8,9,10,
  11.   11,12 & 13, remember the video adapter MUST BE VGA or better).  And work
  12.   together with QuickBASIC's internal text routines (including PALETTE &
  13.   PALETTE USING).  These routines directly modify the video's internal
  14.   palette registers for blazing speed verses using the PALETTE commands.
  15.  
  16.  
  17. * How do I use GPAL?
  18.  
  19.   These routines are very simple to use, first load QuickBASIC (or BASCOM 7.1)
  20.   with the 'Quick Library' file for your version of BASIC (BC7GPAL or QBGPAL).
  21.   Usually like so:
  22.  
  23.   QBX /L BC7GPAL             (BASCOM 7.1)
  24.  
  25.   QB  /L QBGPAL              (QuickBASIC)
  26.  
  27.  
  28.   Then you'll want to include the file 'GPAL.BI' like so:
  29.  
  30.   ' $INCLUDE: 'GPAL.BI'
  31.  
  32.   After that your ready to begin calling the routines.  The first routine you
  33.   want to call is 'InitGPALDriver' this routine intializes the video card and
  34.   gets the current default palette settings.  After doing this all the other
  35.   routines you just call whenever you want graphic fading or to create effects!
  36.  
  37.  
  38.  
  39. * Routine Summary:
  40.  
  41.  
  42. Name: InitGPALDriver
  43.  
  44.   Initializes the video card & routines.  This routine uses some of
  45.   BASIC's heap to store some video card settings.  The space used by
  46.   this routine is 784 bytes.
  47.  
  48.  -> NOTE: Always call this routine after
  49.           changing the video palette settings
  50.           or after calling the CLEAR statement,
  51.           if you don't the fading will not work right!
  52.  
  53.     InitGPALDriver
  54.  
  55.  
  56. Name: GBlankPalette
  57.  
  58.   Blanks out the palette.  (Sets to black)
  59.  
  60.     Speed% = 1
  61.     GBlankPalette Speed%
  62.  
  63. Speed% - 0 for instant, 1 for a slow 'dissolve' effect
  64.  
  65.  
  66. Name: GSavePalette
  67.  
  68.   Saves a palette to disk, if no extention is given, the routine
  69.   will assume the extention .PAL  (See GLoadPalette)
  70.  
  71.     FileName$ = "TEST"
  72.     GSavePalette FileName$
  73.  
  74. FileName$ - Filename to save palette as.  (May include path)
  75.  
  76.  
  77. Name: GLoadPalette
  78.  
  79.   Loads a palette from disk, if no extention is given the routine
  80.   will assume the extention .PAL  (See GSavePalette)
  81.  
  82.     FileName$ = "TEST"
  83.     GLoadPalette FileName$, ErrCode%
  84.  
  85. FileName$ - Palette filename to load.  (May include path)
  86. -----
  87. ErrCode%  -  0 no error
  88.             -1 Not a GPAL file
  89.  
  90.  
  91. Name: GStorePalette
  92.  
  93.   Stores a copy of the current palette in memory.  Storing a palette in
  94.   memory requires only 768 bytes.  GStorePalette can hold upto 5 palettes in
  95.   memory at one time.  (See GRestorePalette)
  96.  
  97.  -> NOTE:  The copy of the palette is stored in BASIC's heap,
  98.            thus if you call the CLEAR statement, you will erase
  99.            the stored palette.
  100.  
  101.     Index% = 0
  102.     GStorePalette Index%
  103.  
  104. Index% - Range 0-4, you may store upto 5 palettes in memory by specifying
  105.          an index.
  106.  
  107.  
  108. Name: GRestorePalette
  109.  
  110.   Restores the stored palette in memory.  Sets it in the palette registers
  111.   so it becomes the current palette.  (See GStorePalette)
  112.  
  113.  -> NOTE:  The copy of the palette is stored in BASIC's heap,
  114.            thus if you call the CLEAR statement, you will erase
  115.            the stored palette.
  116.  
  117.     Index% = 1
  118.     GRestorePalette Index%
  119.  
  120. Index% - Range 0-4, you may store upto 5 palettes in memory by specifying
  121.          an index.
  122.  
  123.  
  124. Name: GFadeInPalette
  125.  
  126.   Fades a graphic palette into view.  (See GFadeOutPalette)
  127.  
  128.     FadeSpeed% = 3
  129.     GFadeInPalette FadeSpeed%
  130.  
  131. FadeSpeed% - 1-10, 1 being the slowest
  132.              (Use 0 for instant palette set)
  133.  
  134.  
  135. Name: GFadeOutPalette
  136.  
  137.   Fades a palette out of view.    (See GFadeInPalette)
  138.  
  139.     FadeSpeed% = 3
  140.     GFadeOutPalette FadeSpeed%
  141.  
  142. FadeSpeed% - 1-10, 1 being the slowest
  143.  
  144.  
  145. Name: GrafLoad
  146.  
  147.   Loads a graphic screen from disk to screen, also loads a graphic screen
  148.   stored in an EXE file.  When loading images attached to EXE files you
  149.   must be using screen 13 (320x200x256 MCGA) or you will get "Video Mode
  150.   not supported" error.  Also loading images from EXE files requires 97k free
  151.   of drive space on the users end, as GrafLoad creates a temp. file.  Loading
  152.   images from EXE files is also much slower because GrafLoad must find the
  153.   image and palette first in the EXE file.  Use ADDIMAGE to attach an image
  154.   to an EXE file.  (See GrafSave)
  155.  
  156.     FileName$ = "TEST.GRA"
  157.     Options% = 7
  158.     GrafLoad FileName$, Options%, ErrCode%
  159.  
  160. FileName$ - Filename of image to load.  When loading images from EXE files
  161.             just specify the name, GrafLoad will sense if it is an EXE file or
  162.             not.  (May include path)
  163.  
  164. Options%  - 0  = Load image only, no palette
  165.             1  = Load palette before image
  166.             2  = Load palette after image
  167.             3+ = Fade-in palette after image
  168.                  (Add three to the fade speed you want, for ex.: if you want
  169.                   a fade speed of 4 then you add 4+3 and get 7)
  170. -----
  171. ErrCode%  - 0 Loaded okay
  172.            -1 Error in palette file
  173.            -2 No image in EXE file
  174.            -3 Video mode not supported
  175.            -4 Not a valid graphic format
  176.            -5 File not found
  177.  
  178.  
  179. Name: GrafSave
  180.  
  181.   Saves a graphic screen to disk.  (See GrafLoad)
  182.  
  183.     FileName$ = "TEST.GRA"
  184.     GrafSave FileName$
  185.  
  186. FileName$ - Filename to save screen as.  (May include path)
  187.  
  188.  
  189. Name: GSetBright
  190.  
  191.   This routine is used for setting the brightness level of the screen.
  192.  
  193.     Brightness% = 31
  194.     GSetBright Brightness%  ' Set the display to 50% brightness
  195.  
  196. Brightness% - Range 1-63, brightness (intensity) level of the screen.
  197.                (use 0 to restore the brightness level)
  198.  
  199.  
  200. Name: MoveDisplay
  201.  
  202.   Moves the display up/down/left/right with a 'panning' effect.
  203.  
  204.     xAxis% = 5
  205.     yAxis% = 0
  206.     MoveDisplay xAxis%, yAxis%
  207.  
  208. xAxis% - Horizontal alignment  (use 0 to restore proper setting)
  209. yAxis% - Vertical alignment  (use 0 to restore proper setting)
  210.  
  211.  
  212. Name: GPal
  213.  
  214.   GPal sets the palette in screen mode 13, this routine lets you set the
  215.   RGB palette intensity.  You can create upto 256,000 colors!
  216.  
  217.     Colour% = 1
  218.     Red% = 40
  219.     Green% = 40
  220.     Blue% = 40
  221.  
  222.     GPal Colour%, Red%, Green%, Blue%
  223.  
  224. Colour%  - The color to set the new palette to (range 0-255)
  225. Red%     - Red palette intensity
  226. Green%   - Green palette intensity
  227. Blue%    - Blue palette intensity
  228.  
  229.  
  230. * Notes:
  231.  
  232.   These routines are designed to use very little heap space, the most these
  233.   routines will use is 2k (2000 bytes).
  234.  
  235.   I've included QwikHelp(C) into the 'GPAL.BI' file.  If you need help with
  236.   a routine, move the cursor under the routine name and press 'F1' from
  237.   there you will get some quick information on that routine!  (Saves alot
  238.   of time!)
  239.  
  240.   (QwikHelp (C) Copyright 1993 Peak Computing)
  241.  
  242.